package com.ldr.custom.spring.demo.action;


import com.ldr.custom.spring.annotation.GPController;
import com.ldr.custom.spring.annotation.GPRequestMapping;
import com.ldr.custom.spring.annotation.GPRequestParam;

import java.util.HashMap;
import java.util.Map;

@GPRequestMapping("/login")
@GPController
public class LoginController {

    @GPRequestMapping("/doLogin")
    public Map<String, Object> login(@GPRequestParam("account") String account, @GPRequestParam("password") String password) {

        if ("root@".equals(account) && "123".equals(password)) {
            Map<String,Object> user=new HashMap<>();

            user.put("name", "张三");
            user.put("age", "14");

            return user;
        }
        return null;
    }
}
